package com.pactera.asmp.server.dao;

import com.pactera.asmp.server.entity.*;
import com.pactera.asmp.server.pojo.ScriptInfo;
import com.pactera.asmp.server.pojo.TestReport;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ProjectName: asmp-server
 * @Package com.pactera.asmp.server.dao
 * @ClassName: TestReportMapper
 * @Description: TestReportMapper
 * @Date 2020/07/14 17:12
 * @Author lvzhiqiang
 * @Version 1.0
 */
@Mapper
public interface TestReportMapper {

    List<TestReport> select(@Param("testReportSearchDTO") TestReportSearchDTO testReportSearchDTO);

    List<TestReport> select2(@Param("testReportSearchDTO") TestReportSearchDTO testReportSearchDTO);

    List<TestReport> selectByScriptIds(@Param("scriptIds")List<Integer> scriptIds);

    int insert(TestReport testReport);

    int update(TestReport testReport);

    int deleteByPrimaryKeys(List<Integer> datas);

    List<TaskReportChartVO> getTaskReportCategoryChart(@Param("taskId") Integer taskId);
    List<TaskReportList> getTaskReportList(@Param("taskIds") List<Integer> taskIds);

    List<String> getScriptIdsByProjectId(@Param("projectId") Integer projectId);
    List<TaskReportChartVO> getProjectReportChartByCategory(@Param("scriptIds")List<Integer> scriptIds);
    List<TaskReportChartVO> getProjectReportChartByModule(@Param("scriptIds")List<Integer> scriptIds);
    List<TaskReportList> getProjectReportChartModuleExec(@Param("projectId") Integer projectId);

    List<SelectTestReportResult> selectAll(Integer taskId);

    int inserBatch(List<TestReportDTO> reports);

    List<ScriptInfo> getScriptsByIds(@Param("scriptIds")List<Integer> scriptIds);

    List<TaskReportChartVO> getTaskReportModuleChart(Integer taskId);

    int insert2(TestReportDTO testReportDTO);

    List<TestReport> getFailReports(@Param("taskId")Integer taskId,@Param("moduleId") Integer moduleId);

    List<TaskFailCount> getTaskFailCountListByProjectId(@Param("projectId") Integer projectId);

    Integer getTaskSuccessByParentId(@Param("parentId") Integer parentId);
    Integer getTaskFailByParentId(@Param("parentId") Integer parentId);
}
